public class Phonetest38 {
    public static void main(String[] args) {
        Phone[] arr = new Phone[3];
        Phone phone1 = new Phone("华为",4999,"白");
        arr[0] = phone1;
        Phone phone2 = new Phone("小米",4599,"黑");
        arr[1] = phone2;
        Phone phone3 = new Phone("苹果",6899,"金");
        arr[2] = phone3;
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i].getPrice();
        }
        int arg = sum / arr.length;
        System.out.println(arg);
    }
}
